home *** CD-ROM | disk | FTP | other *** search
- Path: abcfd20.larc.nasa.gov!amiga-request
- From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v90i249: DKBTrace 2.01 - DKBtrace Ray-Tracer, Part01/10
- Reply-To: David Schanen <mtv@milton.u.washington.edu>
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga:v90i249@abcfd20.larc.nasa.gov>
- Date: 03 Sep 90 23:21:25 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga
-
- Submitted-by: David Schanen <mtv@milton.u.washington.edu>
- Posting-number: Volume 90, Issue 249
- Archive-name: applications/dkbtrace-2.01/part01
-
- [ sample data files are in the comp.binaries.amiga postings ...tad ]
-
- This program is a ray tracer written completely in C. It supports
- arbitrary quadric surfaces (spheres, ellipsoids, cones, cylinders,
- planes, etc.), constructive solid geometry, and various shading models
- (reflection, refraction, marble, wood, and many others). It also has
- special-case code to handle spheres, planes, triangles, and smooth
- triangles. By using these special primitives, the rendering can be done
- much more quickly than by using the more general quadrics.
- In order to create pictures with this program, you must describe the
- objects in the world. This description is a text file called
- "<filename>.data", and <filename> defaults to "object" if not specified.
- Normally, such files are difficult to write and to read. In order to
- make this task easier, the program contains a two-pass parser to read
- the data file. It allows the user to easily create complex worlds from
- simple components. Since the parser allows include files, the user may
- put the object descriptions into different files and combine them all
- into one final image.
-
- The Amiga archive here contains two versions of the raytracer:
-
- traceffp - Fast Floating Point version of the raytracer.
- This version will run on any Amiga with sufficient
- memory.
-
- trace881 - Math coprocessor version. This version will only
- run on 68020 or 68030 based systems that have a
- 68881 or 68882 math coprocessor.
-
- I usually like having a fairly large stack for this program. If it
- crashes on you, try inceasing the stack size.
-
- In addition, the following utilities are provided (these will run on any
- AMIGA system).
-
- DumpToIFF - Converts the raw 24 bit output files of the raytracer into
- hires HAM images.
-
- Dump2RGB - Converts the raw 24 bit output files of the raytracer into
- three separate dump files for red, green and blue.
-
- Dump2Raw - Same as Dump2RGB but takes the size from the input file
- and takes less memory.
-
- Sculpt2DKB - Converts a Sculpt-Animate 3D .scene file into DKB format.
- At the current time, smoothed triangles are not supported. The
- only information converted is the information on the polygons,
- the colours, and the textures. Lightsources, viewpoints, and
- world information is currently ignored.
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 10)."
- # Contents: Docs Docs/AmigaUtils.doc Docs/Porting.doc Docs/read.me
- # Docs/trace.def Docs/unixreadme.doc src src/DKB.LNK src/DKB87.LNK
- # src/Dump2Raw.c src/amigaconf.h src/colour.c src/config.h
- # src/dumproto.h src/dumptoiff.h src/ibmconf.h src/packer.c
- # src/putpict.c src/ray.c src/read.me src/showprioq.h src/unix.c
- # src/unixconf.h src/vector.h src/viewpnt.c src/withfile
- # Wrapped by tadguy@abcfd20 on Mon Sep 3 19:21:14 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test ! -d 'Docs' ; then
- echo shar: Creating directory \"'Docs'\"
- mkdir 'Docs'
- fi
- if test -f 'Docs/AmigaUtils.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Docs/AmigaUtils.doc'\"
- else
- echo shar: Extracting \"'Docs/AmigaUtils.doc'\" \(1605 characters\)
- sed "s/^X//" >'Docs/AmigaUtils.doc' <<'END_OF_FILE'
- XThe following utilities are provided for the Amiga computer. Some of these
- Xmay be useful on other systems as well if you can get hold of Amiga-format
- Xdata files.
- X
- X
- XThese utilities are freely distributable. See DKB.DOC for complete
- Xcopyright and distribution information.
- X
- X
- X
- XDumpToIFF - Converts the raw 24 bit output files of the raytracer into
- X hires HAM images.
- X
- X syntax:
- X DumpToIFF [options] input-file [output-file [palette-file]]
- X
- X options are:
- X -d Suppress Floyd Steinberg dithering
- X -pfilename Output a colour palette for the picture
- X
- X The colour palette for one image may be used in other images.
- X This is useful for animations in order to force the entire
- X animation to use the same colour palette.
- X
- X eg.
- X DumpToIFF -pmyImage.palette myImage.dis myImage.ham
- X DumpToIFF myImage2.dis myImage2.ham myImage.palette
- X
- X
- XSculpt2DKB - Converts a Sculpt-Animate 3D .scene file into DKB format. At
- X the current time, smoothed triangles are not supported. The
- X only information converted is the information on the polygons,
- X the colours, and the textures. Lightsources, viewpoints, and
- X world information is currently ignored.
- X
- X syntax:
- X Sculpt2DKB scene-file dkb-dat-file
- X
- X You must edit this file after the conversion to add a viewpoint
- X and lightsources as needed.
- X
- XDavid Buck
- END_OF_FILE
- if test 1605 -ne `wc -c <'Docs/AmigaUtils.doc'`; then
- echo shar: \"'Docs/AmigaUtils.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/AmigaUtils.doc'
- fi
- if test -f 'Docs/Porting.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Docs/Porting.doc'\"
- else
- echo shar: Extracting \"'Docs/Porting.doc'\" \(2760 characters\)
- sed "s/^X//" >'Docs/Porting.doc' <<'END_OF_FILE'
- X
- X
- X
- X Porting DKBTrace to Other Platforms
- X
- X
- X The 2.0 version of DKBTrace is much more portable than pervious versions.
- X In order to port the ray tracer to different systems, you should only
- X need to create two files:
- X
- X <system>-config.h - This is a system-specific header file which
- X defines all constants and macros for the
- X raytracer. Currently, there are config files
- X for the Amiga, IBM Turbo C, and Unix.
- X
- X <system>.c - This module contains all system-specific
- X code and variables.
- X
- X In the system.c file, you must define four functions:
- X
- X void display_init (void);
- X - initialize the display for drawing the image
- X
- X void display_plot (int x, int y, char Red, char Green, char Blue);
- X - display the given colour at the given x,y coordinates
- X
- X void display_finished (void);
- X - perform any operations necessary after the raytracing is
- X finished.
- X
- X void display_close (void);
- X - close the display
- X
- X
- X The display_finished routine is called before the raytracer prompts
- X the user to hit return to finish at the end of the raytrace. On the
- X Amiga, this function closes the requestor that allowed the raytracer
- X to be halted prematurely. On most other systems, this function would
- X be an empty function.
- X
- X
- X DKBTrace version 2.0 uses ANSI prototypes to perform parameter type
- X checking. If your compiler doesn't support ANSI prototypes, then
- X place the following line in your system-congig.h file:
- X
- X #define PARAMS ()
- X
- X If your compiler does support prototypes, place the following line
- X in the system-config.h file:
- X
- X #define PARAMS x
- X
- X
- X
- X NOTE: Before compiling on a new system, rename your system-config.h
- X file to config.h
- X
- X
- X
- X One final request:
- X
- X If you are porting to another system, PLEASE try to change only the
- X two files that you created. If you must make changes elsewhere in
- X the system, first ask yourself "Is there any way I can do this by
- X just changing the header file?" If there is, then do it. If there
- X is absolutely no way you can get it to work otherwise, then you can
- X change code elsewhere in the system. I would appreciate it if the
- X raytracer remained as portable as possible.
- X
- X
- X If you port the system to another platform, please send me the modified
- X files. I would like to keep them in case I get requests for ports to
- X that system. Keep in mind, that any ports must be made freely
- X distributable and source code must be available free of charge to anyone
- X who wants it.
- X
- X
- XThanks.
- XDavid Buck
- END_OF_FILE
- if test 2760 -ne `wc -c <'Docs/Porting.doc'`; then
- echo shar: \"'Docs/Porting.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/Porting.doc'
- fi
- if test -f 'Docs/read.me' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Docs/read.me'\"
- else
- echo shar: Extracting \"'Docs/read.me'\" \(3796 characters\)
- sed "s/^X//" >'Docs/read.me' <<'END_OF_FILE'
- X
- X DKBTrace
- X
- X
- X
- X
- X This ray tracer was written by David K. Buck and is released as freely
- X distributable software. The author retains all copyrights but permits
- X free distribution of the software through any medium. The software may
- X be used without charge so long as the code is not included in any
- X commercial product.
- X
- X
- X The Amiga archive here contains two versions of the raytracer:
- X
- X traceffp - Fast Floating Point version of the raytracer.
- X This version will run on any Amiga with sufficient
- X memory.
- X
- X trace881 - Math coprocessor version. This version will only
- X run on 68020 or 68030 based systems that have a
- X 68881 or 68882 math coprocessor.
- X
- X
- X I usually like having a fairly large stack for this program. If it
- X crashes on you, try inceasing the stack size.
- X
- X
- X In addition, the following utilities are provided (these will run on any
- X AMIGA system).
- X
- X DumpToIFF - Converts the raw 24 bit output files of the raytracer into
- X hires HAM images.
- X
- X syntax:
- X DumpToIFF [options] input-file [output-file [palette-file]]
- X
- X options are:
- X -d Suppress Floyd Steinberg dithering
- X -pfilename Output a colour palette for the picture
- X
- X The colour palette for one image may be used in other images.
- X This is useful for animations in order to force the entire
- X animation to use the same colour palette.
- X
- X eg.
- X DumpToIFF -pmyImage.palette myImage.dis myImage.ham
- X DumpToIFF myImage2.dis myImage2.ham myImage.palette
- X
- X
- X Dump2RGB - Converts the raw 24 bit output files of the raytracer into
- X three separate dump files for red, green and blue.
- X
- X syntax:
- X Dump2RGB [options] input-file
- X
- X options are:
- X -wxxx Output image width
- X -hxxx Output image height
- X
- X Dump2Raw - Same as Dump2RGB but takes the size from the input file
- X and takes less memory.
- X
- X Sculpt2DKB - Converts a Sculpt-Animate 3D .scene file into DKB format.
- X At the current time, smoothed triangles are not supported. The
- X only information converted is the information on the polygons,
- X the colours, and the textures. Lightsources, viewpoints, and
- X world information is currently ignored.
- X
- X syntax:
- X Sculpt2DKB scene-file dkb-dat-file
- X
- X You must edit this file after the conversion to add a viewpoint
- X and lightsources as needed.
- X
- X
- X The program documentation can be found in the file DKB.DOC and the
- X documentation for some Amiga specific utilities may be found in
- X AmigaUtils.doc.
- X
- X This program is being distributed in four separate packages:
- X
- X
- X DKBTrace.lzh: Executables for traceffp and trace881
- X documentation files
- X DumpToIFF and Sculpt2DKB executables
- X
- X DKBData.lzh Many sample data files
- X
- X DKBSource.lzh Source code for DKBTrace, Amiga utilities, and
- X IBM Utilities.
- X
- X
- X DKBPics.lzh Sample pictures produced by the raytracer.
- X (you could render these yourself using the
- X data files in the DKBTrace.lzh archive)
- X
- X
- X There is a document in the DKBTrace.lzh archive which describes the
- X conversions required to use data files for DKBTrace version 1.2 with
- X the new 2.0 version. This file is called 12to20.doc
- X
- X This readme file is in all three archives.
- END_OF_FILE
- if test 3796 -ne `wc -c <'Docs/read.me'`; then
- echo shar: \"'Docs/read.me'\" unpacked with wrong size!
- fi
- # end of 'Docs/read.me'
- fi
- if test -f 'Docs/trace.def' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Docs/trace.def'\"
- else
- echo shar: Extracting \"'Docs/trace.def'\" \(33 characters\)
- sed "s/^X//" >'Docs/trace.def' <<'END_OF_FILE'
- X-w319 -h400 +v +d -t +p -e +a0.3
- END_OF_FILE
- if test 33 -ne `wc -c <'Docs/trace.def'`; then
- echo shar: \"'Docs/trace.def'\" unpacked with wrong size!
- fi
- # end of 'Docs/trace.def'
- fi
- if test -f 'Docs/unixreadme.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Docs/unixreadme.doc'\"
- else
- echo shar: Extracting \"'Docs/unixreadme.doc'\" \(831 characters\)
- sed "s/^X//" >'Docs/unixreadme.doc' <<'END_OF_FILE'
- XThis text file is to help people with UNIX systems compile DKBTrace. The
- Xraytracer was originally written for Amiga systems and was made portable to
- XIBM's and UNIX systems. Due to the wide variety of UNIX systems, however,
- Xit is difficult to make the code truly portable from system to system.
- X
- XFor a SUN 4, the instructions are as follows:
- X
- X 1) cp unixconfig.h config.h
- X 2) Edit config.h and add the line:
- X #define volatile
- X (to compensate for stupid compilers)
- X 3) Take the unixmakefile supplied in this directory and rename
- X it to Makefile.
- X 4) Type "make"
- X
- XHopefully, everything will work. The output file format is very similar to
- XQRT format except that the colours range from 0 to 255 instead of 0 to 127.
- XWith the proper modifications, the Fuzzy Bit Map tools can display the
- Xresulting images.
- END_OF_FILE
- if test 831 -ne `wc -c <'Docs/unixreadme.doc'`; then
- echo shar: \"'Docs/unixreadme.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/unixreadme.doc'
- fi
- if test ! -d 'src' ; then
- echo shar: Creating directory \"'src'\"
- mkdir 'src'
- fi
- if test -f 'src/DKB.LNK' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/DKB.LNK'\"
- else
- echo shar: Extracting \"'src/DKB.LNK'\" \(213 characters\)
- sed "s/^X//" >'src/DKB.LNK' <<'END_OF_FILE'
- Xc:\lib\c0l+trace+render+tokenize+parse+objects+spheres+quadrics+triangle+
- Xlighting+prioq+texture+matrices+csg+colour+viewpnt+ray+planes+iff+gif+
- Xgifdecod+raw+ibm
- Xdkb
- Xdkb/m
- Xc:\lib\emu+c:\lib\mathl+c:\lib\cl;
- END_OF_FILE
- if test 213 -ne `wc -c <'src/DKB.LNK'`; then
- echo shar: \"'src/DKB.LNK'\" unpacked with wrong size!
- fi
- # end of 'src/DKB.LNK'
- fi
- if test -f 'src/DKB87.LNK' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/DKB87.LNK'\"
- else
- echo shar: Extracting \"'src/DKB87.LNK'\" \(214 characters\)
- sed "s/^X//" >'src/DKB87.LNK' <<'END_OF_FILE'
- Xc:\lib\c0l+trace+render+tokenize+parse+objects+spheres+quadrics+triangle+
- Xlighting+prioq+texture+matrices+csg+colour+viewpnt+ray+planes+iff+gif+
- Xgifdecod+raw+ibm
- Xdkb
- Xdkb/m
- Xc:\lib\fp87+c:\lib\mathl+c:\lib\cl;
- END_OF_FILE
- if test 214 -ne `wc -c <'src/DKB87.LNK'`; then
- echo shar: \"'src/DKB87.LNK'\" unpacked with wrong size!
- fi
- # end of 'src/DKB87.LNK'
- fi
- if test -f 'src/Dump2Raw.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/Dump2Raw.c'\"
- else
- echo shar: Extracting \"'src/Dump2Raw.c'\" \(4320 characters\)
- sed "s/^X//" >'src/Dump2Raw.c' <<'END_OF_FILE'
- X/**********************************************************
- X
- XDUMP2RAW.C - Converts a DKB/QRT "Dump" format raw file to
- X PICLAB's "raw" format, which is 3 files of
- X 8-Bit pixel data named .R8, .B8, and .G8.
- X On the Amiga, names are .red, .grn, and .blu.
- X By Aaron A. Collins, written on 6/30/90
- X
- X This file is released to the Public Domain.
- X
- X PICLAB is a trademark of The Stone Soup Group.
- X
- X ***********************************************************/
- X
- X#include <stdio.h>
- X#include <string.h>
- X#include "config.h"
- X
- X#ifndef TRUE
- X#define TRUE 1
- X#define FALSE 0
- X#endif
- X
- X/* #define IBM TRUE */
- X
- X#define Amiga TRUE
- X
- X#define MAXXRES 2048 /* huge max x resolution allowable, infinite y res. */
- X
- Xunsigned char linbuf[MAXXRES * 3];
- X
- Xvoid main(argc,argv)
- Xint argc;
- Xchar *argv[];
- X{
- X int xres, yres, xhi, yhi, noext = FALSE;
- X register int x, y;
- X char inname[80], rname[80], bname[80], gname[80], tmpname[80];
- X FILE *in, *rout, *bout, *gout;
- X
- X printf("\n\nDKB/QRT Image File to Raw R-G-B Files Converter\n");
- X printf("By Aaron A. Collins. Written 6/30/90\n\n");
- X
- X if (argc < 2)
- X {
- X printf("Usage: %s InFile[.DIS]\n\n",argv[0]);
- X exit(1);
- X }
- X
- X strcpy(inname, argv[1]); /* get input filename */
- X
- X strcpy(tmpname, inname);
- X strupr(tmpname); /* Cvt to uppercase */
- X if (!strstr(tmpname, ".DIS")) /* if user didn't supply .DIS ext, */
- X if (!strchr(tmpname, '.')) /* AND didn't supply ANY ext */
- X {
- X noext = TRUE;
- X strcat(inname, ".DIS");
- X }
- X
- X if ((in = fopen(inname, "rb")) == NULL) /* try w/supplied ext. */
- X {
- X printf("ERROR - Couldn't open file %s\n", inname);
- X exit(1);
- X }
- X
- X if (noext)
- X {
- X strcpy(rname, argv[1]); /* copy name w/no extension */
- X strcpy(gname, argv[1]);
- X strcpy(bname, argv[1]);
- X }
- X else
- X {
- X strcpy(tmpname, argv[1]); /* Get Input Filename */
- X strupr(tmpname); /* Cvt to uppercase */
- X *strchr(tmpname, '.') = '\0'; /* Find the Dot + Truncate */
- X strcpy(rname, tmpname); /* copy name w/no extension */
- X strcpy(gname, tmpname);
- X strcpy(bname, tmpname);
- X }
- X#ifdef IBM
- X strcat(rname, ".R8");
- X strcat(gname, ".G8");
- X strcat(bname, ".B8");
- X#endif
- X
- X#ifdef Amiga
- X strcat(rname, ".red");
- X strcat(gname, ".grn");
- X strcat(bname, ".blu");
- X#endif
- X
- X if ((rout = fopen(rname, "wb")) == NULL)
- X {
- X printf("ERROR - Couldn't create file %s\n", rname);
- X fclose(in);
- X exit(1);
- X }
- X
- X if ((gout = fopen(gname, "wb")) == NULL)
- X {
- X printf("ERROR - Couldn't create file %s\n", gname);
- X fclose(in);
- X fclose(rout);
- X exit(1);
- X }
- X
- X if ((bout = fopen(bname, "wb")) == NULL)
- X {
- X printf("ERROR - Couldn't create file %s\n", bname);
- X fclose(in);
- X fclose(rout);
- X fclose(gout);
- X exit(1);
- X }
- X
- X /** load x and y resolution from input DUMP file **/
- X
- X xres = fgetc(in); /* lo order */
- X xhi = fgetc(in); /* hi order */
- X xres += ((unsigned int) xhi) << 8;
- X
- X if (xres > MAXXRES) /* too big? */
- X {
- X printf("ERROR - X res. of %s (%d) exceeds maximum (%d)!\n", inname, xres, MAXXRES);
- X fclose(in); /* close all files */
- X fclose(rout);
- X fclose(gout);
- X fclose(bout);
- X unlink(rname); /* delete empty out files */
- X unlink(gname);
- X unlink(bname);
- X exit(1);
- X }
- X
- X yres = fgetc(in); /* now do yres the same... */
- X yhi = fgetc(in);
- X yres += ((unsigned int) yhi) << 8;
- X
- X printf("Input file = %s\n", inname); /* show stats */
- X printf("Output files = %s\n", rname);
- X printf(" %s\n", gname);
- X printf(" %s\n\n", bname);
- X printf("Image X resolution = %d\n", xres);
- X printf("Image Y resolution = %d\n", yres);
- X
- X printf("\nProcessing Line: 0");
- X
- X for (y = 0; y < yres; y++) /* for every line in the old file */
- X {
- X
- X printf("\b\b\b%3d", y); /* disp. current line # */
- X
- X fread(linbuf, 1, 2, in); /* read in line number */
- X
- X if (feof(in)) /* stop if file truncated */
- X break;
- X
- X for (x = 0; x < 3; x++)
- X {
- X fread(linbuf, 1, xres, in); /* read a line's data */
- X
- X if (feof(in)) /* stop if file truncated */
- X break;
- X
- X switch (x)
- X {
- X case 0:
- X fwrite(linbuf, 1, xres, rout);
- X break;
- X case 1:
- X fwrite(linbuf, 1, xres, gout);
- X break;
- X case 2:
- X fwrite(linbuf, 1, xres, bout);
- X break;
- X }
- X }
- X }
- X printf("\n");
- X fclose(in); /* close all files */
- X fflush(rout);
- X fflush(gout);
- X fflush(bout);
- X fclose(rout);
- X fclose(gout);
- X fclose(bout);
- X exit(0);
- X}
- END_OF_FILE
- if test 4320 -ne `wc -c <'src/Dump2Raw.c'`; then
- echo shar: \"'src/Dump2Raw.c'\" unpacked with wrong size!
- fi
- # end of 'src/Dump2Raw.c'
- fi
- if test -f 'src/amigaconf.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/amigaconf.h'\"
- else
- echo shar: Extracting \"'src/amigaconf.h'\" \(2335 characters\)
- sed "s/^X//" >'src/amigaconf.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* amigaconf.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module contains Amiga-specific defines, types, and other declarations.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X/* For the Amiga, we can use ANSI prototype definitions. */
- X
- X#define PARAMS(x) x
- Xvoid main (int, char**);
- Xvoid exit(int);
- Xvoid *malloc(int);
- Xvoid free(void *);
- X
- Xextern int _bufsiz;
- X#define BUFSIZ _bufsiz
- END_OF_FILE
- if test 2335 -ne `wc -c <'src/amigaconf.h'`; then
- echo shar: \"'src/amigaconf.h'\" unpacked with wrong size!
- fi
- # end of 'src/amigaconf.h'
- fi
- if test -f 'src/colour.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/colour.c'\"
- else
- echo shar: Extracting \"'src/colour.c'\" \(3722 characters\)
- sed "s/^X//" >'src/colour.c' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* colour.c
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module implements routines to manipulate colours.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X#include "frame.h"
- X#include "vector.h"
- X#include "dkbproto.h"
- X
- X#define FABS(x) ((x) < 0.0 ? (0.0 - (x)) : (x))
- X
- XDBL Colour_Distance (colour1, colour2)
- X COLOUR *colour1, *colour2;
- X {
- X return (FABS (colour1->Red - colour2->Red)
- X + FABS (colour1->Green - colour2->Green)
- X + FABS (colour1->Blue - colour2->Blue));
- X }
- X
- Xvoid Add_Colour (result, colour1, colour2)
- X COLOUR *result, *colour1, *colour2;
- X {
- X result->Red = colour1->Red + colour2->Red;
- X result->Green = colour1->Green + colour2->Green;
- X result->Blue = colour1->Blue + colour2->Blue;
- X result->Alpha = colour1->Alpha + colour2->Alpha;
- X }
- X
- Xvoid Scale_Colour (result, colour, factor)
- X COLOUR *result, *colour;
- X DBL factor;
- X {
- X result->Red = colour->Red * factor;
- X result->Green = colour->Green * factor;
- X result->Blue = colour->Blue * factor;
- X result->Alpha = colour->Alpha * factor;
- X }
- X
- Xvoid Clip_Colour (result, colour)
- X COLOUR *result, *colour;
- X {
- X if (colour -> Red > 1.0)
- X result -> Red = 1.0;
- X else if (colour -> Red < 0.0)
- X result -> Red = 0.0;
- X else result -> Red = colour -> Red;
- X
- X if (colour -> Green > 1.0)
- X result -> Green = 1.0;
- X else if (colour -> Green < 0.0)
- X result -> Green = 0.0;
- X else result -> Green = colour -> Green;
- X
- X if (colour -> Blue > 1.0)
- X result -> Blue = 1.0;
- X else if (colour -> Blue < 0.0)
- X result -> Blue = 0.0;
- X else result -> Blue = colour -> Blue;
- X
- X if (colour -> Alpha > 1.0)
- X result -> Alpha = 1.0;
- X else if (colour -> Alpha < 0.0)
- X result -> Alpha = 0.0;
- X else result -> Alpha = colour -> Alpha;
- X }
- END_OF_FILE
- if test 3722 -ne `wc -c <'src/colour.c'`; then
- echo shar: \"'src/colour.c'\" unpacked with wrong size!
- fi
- # end of 'src/colour.c'
- fi
- if test -f 'src/config.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/config.h'\"
- else
- echo shar: Extracting \"'src/config.h'\" \(2291 characters\)
- sed "s/^X//" >'src/config.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* amigaconf.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module contains Amiga-specific defines, types, and other declarations.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X/* For the Amiga, we can use ANSI prototype definitions. */
- X
- X#define PARAMS(x) x
- Xvoid main (int, char**);
- Xvoid exit(int);
- Xvoid *malloc(int);
- Xvoid free(void *);
- END_OF_FILE
- if test 2291 -ne `wc -c <'src/config.h'`; then
- echo shar: \"'src/config.h'\" unpacked with wrong size!
- fi
- # end of 'src/config.h'
- fi
- if test -f 'src/dumproto.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/dumproto.h'\"
- else
- echo shar: Extracting \"'src/dumproto.h'\" \(2971 characters\)
- sed "s/^X//" >'src/dumproto.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* dumproto.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This file contains prototypes for DumpToIFF
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X*
- X*****************************************************************************/
- X
- X/* Prototypes from DumpToIFF.c */
- X
- Xvoid display_close (void);
- Xvoid display_plot (LONG x, LONG y, LONG new_red, LONG new_green, LONG new_blue);
- Xvoid process (LONG x, LONG y, LONG new_red, LONG new_green, LONG new_blue);
- Xvoid ConvertToIFF(char *file_name);
- Xint read_raw_byte(FILE *f);
- Xint read_raw_word(FILE *f);
- Xvoid read_raw_image (IMAGE *Image, char *filename);
- Xvoid dither (IMAGE *Image);
- X
- X/* Prototypes from palette.c */
- X
- Xvoid reset_colours (void);
- Xint closeness(int x, int y);
- Xvoid start_recording_colours (void);
- Xvoid record_colours (int new_red, int new_green, int new_blue);
- Xvoid choose_palette(void);
- Xint best_colour (int new_red, int new_blue, int new_green);
- X
- X/* Prototypes from showpriow.h */
- X
- Xstruct prioq_struct *pq_new (int index_size, int value_size);
- Xvoid pq_add (struct prioq *q, unsigned int index, unsigned int value);
- Xint pq_find_value (struct prioq *q, unsigned int value);
- Xvoid pq_balance(struct prioq *q, unsigned int entry_pos1);
- Xint pq_get_highest_index(struct prioq *q);
- Xint pq_get_highest_value(struct prioq *q);
- Xvoid pq_delete_highest (struct prioq *q);
- Xvoid pq_free (struct prioq *q);
- X
- END_OF_FILE
- if test 2971 -ne `wc -c <'src/dumproto.h'`; then
- echo shar: \"'src/dumproto.h'\" unpacked with wrong size!
- fi
- # end of 'src/dumproto.h'
- fi
- if test -f 'src/dumptoiff.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/dumptoiff.h'\"
- else
- echo shar: Extracting \"'src/dumptoiff.h'\" \(2141 characters\)
- sed "s/^X//" >'src/dumptoiff.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* dumptoiff.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This file contains types and constants for DumpToIFF
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X*
- X*****************************************************************************/
- X
- X#define INT_REV 29L
- X#define GR_REV 29L
- X
- X#define SCREEN_WIDTH 320L
- X#define SCREEN_HEIGHT 400L
- X#define BUFFER_SIZE 8096
- X
- Xstruct Image_Struct
- X {
- X int width, height;
- X unsigned char *red, *green, *blue;
- X };
- Xtypedef struct Image_Struct IMAGE;
- X
- Xextern int Close_Threshold;
- X
- END_OF_FILE
- if test 2141 -ne `wc -c <'src/dumptoiff.h'`; then
- echo shar: \"'src/dumptoiff.h'\" unpacked with wrong size!
- fi
- # end of 'src/dumptoiff.h'
- fi
- if test -f 'src/ibmconf.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/ibmconf.h'\"
- else
- echo shar: Extracting \"'src/ibmconf.h'\" \(2761 characters\)
- sed "s/^X//" >'src/ibmconf.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* ibmconf.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This file contains ibm-specific defines, types, etc.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X#include <conio.h>
- X#include <stdarg.h>
- X#include <stdlib.h>
- X
- X#ifndef TURBOC /* Remove Present Definition */
- X#define TURBOC TRUE /* Un-Comment one set or the other... */
- X#endif
- X
- X/* #define MATH_CO TRUE * Feed this option through CC's comnd line! */
- X
- X#ifdef MATH_CO
- X#define DBL long double
- X#else
- X#define DBL double
- X#endif
- X
- X#ifdef MATH_CO
- X#define DBL_FORMAT_STRING "%Lf"
- X#else
- X#define DBL_FORMAT_STRING "%lf"
- X#endif
- X
- X#define TEST_ABORT if (Options & EXITENABLE) if (kbhit()) { Stop_Flag = TRUE; getch(); }
- X
- X/* This gives us ANSI prototyping */
- X#define PARAMS(x) x
- X
- Xvoid far *farmalloc(unsigned long);
- X#define malloc(size) farmalloc((unsigned long)size)
- END_OF_FILE
- if test 2761 -ne `wc -c <'src/ibmconf.h'`; then
- echo shar: \"'src/ibmconf.h'\" unpacked with wrong size!
- fi
- # end of 'src/ibmconf.h'
- fi
- if test -f 'src/packer.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/packer.c'\"
- else
- echo shar: Extracting \"'src/packer.c'\" \(2762 characters\)
- sed "s/^X//" >'src/packer.c' <<'END_OF_FILE'
- X/*----------------------------------------------------------------------*
- X * packer.c Convert data to "cmpByteRun1" run compression. 11/15/85
- X *
- X * By Jerry Morrison and Steve Shaw, Electronic Arts.
- X * This software is in the public domain.
- X *
- X * control bytes:
- X * [0..127] : followed by n+1 bytes of data.
- X * [-1..-127] : followed by byte to be repeated (-n)+1 times.
- X * -128 : NOOP.
- X *
- X * This version for the Commodore-Amiga computer.
- X *----------------------------------------------------------------------*/
- X#include "iff/packer.h"
- X
- X#define DUMP 0
- X#define RUN 1
- X
- X#define MinRun 3
- X#define MaxRun 128
- X#define MaxDat 128
- X
- XLONG putSize;
- X#define GetByte() (*source++)
- X#define PutByte(c) { *dest++ = (c); ++putSize; }
- X
- Xchar buf[256]; /* [TBD] should be 128? on stack?*/
- X
- XBYTE *PutDump(dest, nn) BYTE *dest; int nn; {
- X int i;
- X
- X PutByte(nn-1);
- X for(i = 0; i < nn; i++) PutByte(buf[i]);
- X return(dest);
- X }
- X
- XBYTE *PutRun(dest, nn, cc) BYTE *dest; int nn, cc; {
- X PutByte(-(nn-1));
- X PutByte(cc);
- X return(dest);
- X }
- X
- X#define OutDump(nn) dest = PutDump(dest, nn)
- X#define OutRun(nn,cc) dest = PutRun(dest, nn, cc)
- X
- X/*----------- PackRow --------------------------------------------------*/
- X/* Given POINTERS TO POINTERS, packs one row, updating the source and
- X destination pointers. RETURNs count of packed bytes.*/
- XLONG PackRow(pSource, pDest, rowSize)
- X BYTE **pSource, **pDest; LONG rowSize; {
- X BYTE *source, *dest;
- X char c,lastc = '\0';
- X BOOL mode = DUMP;
- X short nbuf = 0; /* number of chars in buffer */
- X short rstart = 0; /* buffer index current run starts */
- X
- X source = *pSource;
- X dest = *pDest;
- X putSize = 0;
- X buf[0] = lastc = c = GetByte(); /* so have valid lastc */
- X nbuf = 1; rowSize--; /* since one byte eaten.*/
- X
- X
- X for (; rowSize; --rowSize) {
- X buf[nbuf++] = c = GetByte();
- X switch (mode) {
- X case DUMP:
- X /* If the buffer is full, write the length byte,
- X then the data */
- X if (nbuf>MaxDat) {
- X OutDump(nbuf-1);
- X buf[0] = c;
- X nbuf = 1; rstart = 0;
- X break;
- X }
- X
- X if (c == lastc) {
- X if (nbuf-rstart >= MinRun) {
- X if (rstart > 0) OutDump(rstart);
- X mode = RUN;
- X }
- X else if (rstart == 0)
- X mode = RUN; /* no dump in progress,
- X so can't lose by making these 2 a run.*/
- X }
- X else rstart = nbuf-1; /* first of run */
- X break;
- X
- X case RUN: if ( (c != lastc)|| ( nbuf-rstart > MaxRun)) {
- X /* output run */
- X OutRun(nbuf-1-rstart,lastc);
- X buf[0] = c;
- X nbuf = 1; rstart = 0;
- X mode = DUMP;
- X }
- X break;
- X }
- X
- X lastc = c;
- X }
- X
- X switch (mode) {
- X case DUMP: OutDump(nbuf); break;
- X case RUN: OutRun(nbuf-rstart,lastc); break;
- X }
- X *pSource = source;
- X *pDest = dest;
- X return(putSize);
- X }
- X
- END_OF_FILE
- if test 2762 -ne `wc -c <'src/packer.c'`; then
- echo shar: \"'src/packer.c'\" unpacked with wrong size!
- fi
- # end of 'src/packer.c'
- fi
- if test -f 'src/putpict.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/putpict.c'\"
- else
- echo shar: Extracting \"'src/putpict.c'\" \(3712 characters\)
- sed "s/^X//" >'src/putpict.c' <<'END_OF_FILE'
- X/** putpict.c ***************************************************/
- X/* PutPict(). Given a BitMap and a color map in RAM on the */
- X/* Amiga, outputs as an ILBM. See /iff/ilbm.h & /iff/ilbmw.c. */
- X/* 23-Jan-86 */
- X/* */
- X/* By Jerry Morrison and Steve Shaw, Electronic Arts. */
- X/* This software is in the public domain. */
- X/* */
- X/* This version for the Commodore-Amiga computer. */
- X/* */
- X/****************************************************************/
- X#include "iff/intuall.h"
- X#include "iff/gio.h"
- X#include "iff/ilbm.h"
- X#include "iff/putpict.h"
- X
- X#define MaxDepth 5
- Xstatic IFFP ifferror = 0;
- X
- X#define CkErr(expression) {if (ifferror == IFF_OKAY) ifferror = (expression);}
- X
- X/*****************************************************************************/
- X/* IffErr */
- X/* */
- X/* Returns the iff error code and resets it to zero */
- X/* */
- X/*****************************************************************************/
- XIFFP IffErr()
- X {
- X IFFP i;
- X i = ifferror;
- X ifferror = 0;
- X return(i);
- X }
- X
- X/*****************************************************************************/
- X/* PutPict() */
- X/* */
- X/* Put a picture into an IFF file */
- X/* Pass in mask == NULL for no mask. */
- X/* */
- X/* Buffer should be big enough for one packed scan line */
- X/* Buffer used as temporary storage to speed-up writing. */
- X/* A large buffer, say 8KB, is useful for minimizing Write and Seek calls. */
- X/* (See /iff/gio.h & /iff/gio.c). */
- X/*****************************************************************************/
- X
- XBOOL PutPict(file, vp, buffer, bufsize)
- X LONG file;
- X struct ViewPort *vp;
- X BYTE *buffer;
- X LONG bufsize;
- X {
- X int pageW, pageH;
- X BitMapHeader bmHdr;
- X GroupContext fileContext, formContext;
- X
- X pageW = vp->DWidth;
- X pageH = vp->DHeight;
- X
- X ifferror = InitBMHdr(&bmHdr,
- X vp->RasInfo->BitMap,
- X mskNone,
- X cmpByteRun1,
- X 0,
- X pageW,
- X pageH );
- X
- X/* use buffered write for speedup, if it is big-enough for both
- X * PutBODY's buffer and a gio buffer.*/
- X#define BODY_BUFSIZE 512
- X if (ifferror == IFF_OKAY && bufsize > 2*BODY_BUFSIZE) {
- X if (GWriteDeclare(file, buffer+BODY_BUFSIZE, bufsize-BODY_BUFSIZE) < 0)
- X ifferror = DOS_ERROR;
- X bufsize = BODY_BUFSIZE;
- X }
- X
- X CkErr(OpenWIFF(file, &fileContext, szNotYetKnown) );
- X CkErr(StartWGroup(&fileContext, FORM, szNotYetKnown, ID_ILBM, &formContext) );
- X
- X CkErr(PutCk(&formContext, ID_BMHD, sizeof(BitMapHeader), (BYTE *)&bmHdr));
- X
- X CkErr(PutCAMG(&formContext, vp->Modes));
- X
- X if (vp->ColorMap != NULL)
- X CkErr( PutCMAP(&formContext, vp));
- X CkErr( PutBODY(&formContext, vp->RasInfo->BitMap, NULL, &bmHdr, buffer, bufsize) );
- X
- X CkErr( EndWGroup(&formContext) );
- X CkErr( CloseWGroup(&fileContext) );
- X if (GWriteUndeclare(file) < 0 && ifferror == IFF_OKAY)
- X ifferror = DOS_ERROR;
- X return( (BOOL)(ifferror != IFF_OKAY) );
- X }
- X
- X
- END_OF_FILE
- if test 3712 -ne `wc -c <'src/putpict.c'`; then
- echo shar: \"'src/putpict.c'\" unpacked with wrong size!
- fi
- # end of 'src/putpict.c'
- fi
- if test -f 'src/ray.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/ray.c'\"
- else
- echo shar: Extracting \"'src/ray.c'\" \(4069 characters\)
- sed "s/^X//" >'src/ray.c' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* ray.c
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module implements functions pertaining to rays.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X
- X#include "frame.h"
- X#include "vector.h"
- X#include "dkbproto.h"
- X
- X#define Mix(a,b,c) { \
- X (a).x = (b).x * (c).y; \
- X (a).y = (b).x * (c).z; \
- X (a).z = (b).y * (c).z; }
- X
- Xvoid Make_Ray(r)
- X RAY *r;
- X {
- X VECTOR Temp_Init_Dir;
- X
- X VSquareTerms (r -> Initial_2, r -> Initial);
- X VSquareTerms (r -> Direction_2, r -> Direction);
- X VEvaluate (r -> Initial_Direction, r -> Initial, r -> Direction);
- X Mix (r -> Mixed_Initial_Initial, r -> Initial, r -> Initial);
- X Mix (r -> Mixed_Dir_Dir, r -> Direction, r -> Direction);
- X Mix (Temp_Init_Dir, r -> Initial, r -> Direction);
- X Mix (r -> Mixed_Init_Dir, r -> Direction, r -> Initial);
- X VAdd (r -> Mixed_Init_Dir, r -> Mixed_Init_Dir, Temp_Init_Dir);
- X r -> Quadric_Constants_Cached = TRUE;
- X }
- X
- Xvoid Initialize_Ray_Containers (Ray)
- X RAY *Ray;
- X {
- X Ray -> Containing_Index = -1;
- X }
- X
- Xvoid Copy_Ray_Containers (Dest_Ray, Source_Ray)
- X RAY *Dest_Ray, *Source_Ray;
- X {
- X register int i;
- X
- X if ((Dest_Ray -> Containing_Index = Source_Ray -> Containing_Index)
- X >= MAX_CONTAINING_OBJECTS) {
- X printf ("ERROR - Containing Index too high\n");
- X close_all();
- X exit (0);
- X }
- X
- X for (i = 0 ; i < MAX_CONTAINING_OBJECTS ; i++) {
- X Dest_Ray -> Containing_Objects[i] = Source_Ray -> Containing_Objects[i];
- X Dest_Ray -> Containing_IORs[i] = Source_Ray -> Containing_IORs[i];
- X }
- X }
- X
- Xvoid Ray_Enter (ray, object)
- X RAY *ray;
- X OBJECT *object;
- X {
- X register int index;
- X
- X if ((index = ++(ray -> Containing_Index)) >= MAX_CONTAINING_OBJECTS) {
- X printf ("Too many nested refracting objects\n");
- X close_all();
- X exit(0);
- X }
- X
- X ray -> Containing_Objects [index] = object;
- X ray -> Containing_IORs [index] = object->Object_Texture->Object_Index_Of_Refraction;
- X }
- X
- Xvoid Ray_Exit (ray)
- X RAY *ray;
- X {
- X if (--(ray -> Containing_Index) < -1) {
- X printf ("Too many exits from refractions\n");
- X close_all();
- X exit(0);
- X }
- X }
- END_OF_FILE
- if test 4069 -ne `wc -c <'src/ray.c'`; then
- echo shar: \"'src/ray.c'\" unpacked with wrong size!
- fi
- # end of 'src/ray.c'
- fi
- if test -f 'src/read.me' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/read.me'\"
- else
- echo shar: Extracting \"'src/read.me'\" \(3796 characters\)
- sed "s/^X//" >'src/read.me' <<'END_OF_FILE'
- X
- X DKBTrace
- X
- X
- X
- X
- X This ray tracer was written by David K. Buck and is released as freely
- X distributable software. The author retains all copyrights but permits
- X free distribution of the software through any medium. The software may
- X be used without charge so long as the code is not included in any
- X commercial product.
- X
- X
- X The Amiga archive here contains two versions of the raytracer:
- X
- X traceffp - Fast Floating Point version of the raytracer.
- X This version will run on any Amiga with sufficient
- X memory.
- X
- X trace881 - Math coprocessor version. This version will only
- X run on 68020 or 68030 based systems that have a
- X 68881 or 68882 math coprocessor.
- X
- X
- X I usually like having a fairly large stack for this program. If it
- X crashes on you, try inceasing the stack size.
- X
- X
- X In addition, the following utilities are provided (these will run on any
- X AMIGA system).
- X
- X DumpToIFF - Converts the raw 24 bit output files of the raytracer into
- X hires HAM images.
- X
- X syntax:
- X DumpToIFF [options] input-file [output-file [palette-file]]
- X
- X options are:
- X -d Suppress Floyd Steinberg dithering
- X -pfilename Output a colour palette for the picture
- X
- X The colour palette for one image may be used in other images.
- X This is useful for animations in order to force the entire
- X animation to use the same colour palette.
- X
- X eg.
- X DumpToIFF -pmyImage.palette myImage.dis myImage.ham
- X DumpToIFF myImage2.dis myImage2.ham myImage.palette
- X
- X
- X Dump2RGB - Converts the raw 24 bit output files of the raytracer into
- X three separate dump files for red, green and blue.
- X
- X syntax:
- X Dump2RGB [options] input-file
- X
- X options are:
- X -wxxx Output image width
- X -hxxx Output image height
- X
- X Dump2Raw - Same as Dump2RGB but takes the size from the input file
- X and takes less memory.
- X
- X Sculpt2DKB - Converts a Sculpt-Animate 3D .scene file into DKB format.
- X At the current time, smoothed triangles are not supported. The
- X only information converted is the information on the polygons,
- X the colours, and the textures. Lightsources, viewpoints, and
- X world information is currently ignored.
- X
- X syntax:
- X Sculpt2DKB scene-file dkb-dat-file
- X
- X You must edit this file after the conversion to add a viewpoint
- X and lightsources as needed.
- X
- X
- X The program documentation can be found in the file DKB.DOC and the
- X documentation for some Amiga specific utilities may be found in
- X AmigaUtils.doc.
- X
- X This program is being distributed in four separate packages:
- X
- X
- X DKBTrace.lzh: Executables for traceffp and trace881
- X documentation files
- X DumpToIFF and Sculpt2DKB executables
- X
- X DKBData.lzh Many sample data files
- X
- X DKBSource.lzh Source code for DKBTrace, Amiga utilities, and
- X IBM Utilities.
- X
- X
- X DKBPics.lzh Sample pictures produced by the raytracer.
- X (you could render these yourself using the
- X data files in the DKBTrace.lzh archive)
- X
- X
- X There is a document in the DKBTrace.lzh archive which describes the
- X conversions required to use data files for DKBTrace version 1.2 with
- X the new 2.0 version. This file is called 12to20.doc
- X
- X This readme file is in all three archives.
- END_OF_FILE
- if test 3796 -ne `wc -c <'src/read.me'`; then
- echo shar: \"'src/read.me'\" unpacked with wrong size!
- fi
- # end of 'src/read.me'
- fi
- if test -f 'src/showprioq.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/showprioq.h'\"
- else
- echo shar: Extracting \"'src/showprioq.h'\" \(2050 characters\)
- sed "s/^X//" >'src/showprioq.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* showprioq.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This file contains types and constants for showprioq
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X*
- X*****************************************************************************/
- X
- Xstruct q_entry {
- X short index;
- X short value;
- X };
- X
- Xstruct prioq_struct {
- X struct q_entry *queue;
- X unsigned char *array;
- X unsigned int current_entry, queue_size, array_size;
- X };
- X
- END_OF_FILE
- if test 2050 -ne `wc -c <'src/showprioq.h'`; then
- echo shar: \"'src/showprioq.h'\" unpacked with wrong size!
- fi
- # end of 'src/showprioq.h'
- fi
- if test -f 'src/unix.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/unix.c'\"
- else
- echo shar: Extracting \"'src/unix.c'\" \(194 characters\)
- sed "s/^X//" >'src/unix.c' <<'END_OF_FILE'
- Xvoid display_finished ()
- X {
- X }
- X
- Xvoid display_init ()
- X {
- X }
- X
- Xvoid display_close ()
- X {
- X }
- X
- Xvoid display_plot (x, y, Red, Green, Blue)
- X int x, y;
- X char Red, Green, Blue;
- X {
- X }
- X
- END_OF_FILE
- if test 194 -ne `wc -c <'src/unix.c'`; then
- echo shar: \"'src/unix.c'\" unpacked with wrong size!
- fi
- # end of 'src/unix.c'
- fi
- if test -f 'src/unixconf.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/unixconf.h'\"
- else
- echo shar: Extracting \"'src/unixconf.h'\" \(2218 characters\)
- sed "s/^X//" >'src/unixconf.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* unixconf.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This header file contains all constants and types required to run on a
- X* UNIX system.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X/* By default, UNIX doesn't use ANSI prototyping */
- X
- X#define PARAMS(x) ()
- END_OF_FILE
- if test 2218 -ne `wc -c <'src/unixconf.h'`; then
- echo shar: \"'src/unixconf.h'\" unpacked with wrong size!
- fi
- # end of 'src/unixconf.h'
- fi
- if test -f 'src/vector.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/vector.h'\"
- else
- echo shar: Extracting \"'src/vector.h'\" \(3987 characters\)
- sed "s/^X//" >'src/vector.h' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* vector.h
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module contains macros to perform operations on vectors.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X
- X/* Misc. Vector Math Macro Definitions */
- X
- Xextern DBL VTemp;
- X
- X/* Vector Add */
- X#define VAdd(a, b, c) {(a).x=(b).x+(c).x;(a).y=(b).y+(c).y;(a).z=(b).z+(c).z;}
- X
- X/* Vector Subtract */
- X#define VSub(a, b, c) {(a).x=(b).x-(c).x;(a).y=(b).y-(c).y;(a).z=(b).z-(c).z;}
- X
- X/* Scale - Multiply Vector by a Scalar */
- X#define VScale(a, b, k) {(a).x=(b).x*(k);(a).y=(b).y*(k);(a).z=(b).z*(k);}
- X
- X/* Inverse Scale - Divide Vector by a Scalar */
- X#define VInverseScale(a, b, k) {(a).x=(b).x/(k);(a).y=(b).y/(k);(a).z=(b).z/(k);}
- X
- X/* Dot Product - Gives Scalar angle (a) between two vectors (b) and (c) */
- X#define VDot(a, b, c) {a=(b).x*(c).x+(b).y*(c).y+(b).z*(c).z;}
- X
- X/* Cross Product - returns Vector (a) = (b) x (c)
- X WARNING: a must be different from b and c.*/
- X#define VCross(a,b,c) {(a).x=(b).y*(c).z-(b).z*(c).y; \
- X (a).y=(b).z*(c).x-(b).x*(c).z; \
- X (a).z=(b).x*(c).y-(b).y*(c).x;}
- X
- X/* Evaluate - returns Vector (a) = Multiply Vector (b) by Vector (c) */
- X#define VEvaluate(a, b, c) {(a).x=(b).x*(c).x;(a).y=(b).y*(c).y;(a).z=(b).z*(c).z;}
- X
- X/* Square a Vector */
- X#define VSqr(a) {(a).x*(a).x;(a).y*(a).y;(a).z*(a).z;}
- X
- X/* Simple Scalar Square Macro */
- X#define Sqr(a) (a*a)
- X
- X/* Square a Vector (b) and Assign to another Vector (a) */
- X#define VSquareTerms(a, b) {(a).x=(b).x*(b).x;(a).y=(b).y*(b).y;(a).z=(b).z*(b).z;}
- X
- X/* Vector Length - returs Scalar Euclidean Length (a) of Vector (b) */
- X#define VLength(a, b) {a=sqrt((b).x*(b).x+(b).y*(b).y+(b).z*(b).z);}
- X
- X/* Normalize a Vector - returns a vector (length of 1) that points at (b) */
- X#define VNormalize(a,b) {VTemp=sqrt((b).x*(b).x+(b).y*(b).y+(b).z*(b).z);(a).x=(b).x/VTemp;(a).y=(b).y/VTemp;(a).z=(b).z/VTemp;}
- X
- X/* Compute a Vector (a) Halfway Between Two Given Vectors (b) and (c) */
- X#define VHalf(a, b, c) {(a).x=0.5*((b).x+(c).x);(a).y=0.5*((b).y+(c).y);(a).z=0.5*((b).z+(c).z);}
- END_OF_FILE
- if test 3987 -ne `wc -c <'src/vector.h'`; then
- echo shar: \"'src/vector.h'\" unpacked with wrong size!
- fi
- # end of 'src/vector.h'
- fi
- if test -f 'src/viewpnt.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/viewpnt.c'\"
- else
- echo shar: Extracting \"'src/viewpnt.c'\" \(4251 characters\)
- sed "s/^X//" >'src/viewpnt.c' <<'END_OF_FILE'
- X/*****************************************************************************
- X*
- X* viewpnt.c
- X*
- X* from DKBTrace (c) 1990 David Buck
- X*
- X* This module implements methods for managing the viewpoint.
- X*
- X* This software is freely distributable. The source and/or object code may be
- X* copied or uploaded to communications services so long as this notice remains
- X* at the top of each file. If any changes are made to the program, you must
- X* clearly indicate in the documentation and in the programs startup message
- X* who it was who made the changes. The documentation should also describe what
- X* those changes were. This software may not be included in whole or in
- X* part into any commercial package without the express written consent of the
- X* author. It may, however, be included in other public domain or freely
- X* distributed software so long as the proper credit for the software is given.
- X*
- X* This software is provided as is without any guarantees or warranty. Although
- X* the author has attempted to find and correct any bugs in the software, he
- X* is not responsible for any damage caused by the use of the software. The
- X* author is under no obligation to provide service, corrections, or upgrades
- X* to this package.
- X*
- X* Despite all the legal stuff above, if you do find bugs, I would like to hear
- X* about them. Also, if you have any comments or questions, you may contact me
- X* at the following address:
- X*
- X* David Buck
- X* 22C Sonnet Cres.
- X* Nepean Ontario
- X* Canada, K2H 8W7
- X*
- X* I can also be reached on the following bulleton boards:
- X*
- X* ATX (613) 526-4141
- X* OMX (613) 731-3419
- X* Mystic (613) 731-0088 or (613) 731-6698
- X*
- X* Fidonet: 1:163/109.9
- X* Internet: David_Buck@Carleton.CA
- X*
- X* IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
- X*
- X* Lattice BBS (708) 916-1200
- X* The Information Exchange BBS (708) 945-5575
- X* Stillwaters BBS (708) 403-2826
- X*
- X*****************************************************************************/
- X
- X#include "frame.h"
- X#include "vector.h"
- X#include "dkbproto.h"
- X
- XMETHODS Viewpoint_Methods =
- X { NULL, NULL, NULL, NULL, Copy_Viewpoint,
- X Translate_Viewpoint, Rotate_Viewpoint,
- X Scale_Viewpoint, NULL};
- X
- Xvoid *Copy_Viewpoint (Object)
- X OBJECT *Object;
- X {
- X VIEWPOINT *Viewpoint = (VIEWPOINT *) Object;
- X VIEWPOINT *New_Viewpoint;
- X
- X New_Viewpoint = Get_Viewpoint();
- X
- X New_Viewpoint -> Location = Viewpoint -> Location;
- X New_Viewpoint -> Direction = Viewpoint -> Direction;
- X New_Viewpoint -> Right = Viewpoint -> Right;
- X New_Viewpoint -> Up = Viewpoint -> Up;
- X return (New_Viewpoint);
- X }
- X
- Xvoid Translate_Viewpoint (Object, Vector)
- X OBJECT *Object;
- X VECTOR *Vector;
- X {
- X VAdd (((VIEWPOINT *) Object) -> Location,
- X ((VIEWPOINT *) Object) -> Location,
- X *Vector);
- X }
- X
- Xvoid Rotate_Viewpoint (Object, Vector)
- X OBJECT *Object;
- X VECTOR *Vector;
- X {
- X TRANSFORMATION Transformation;
- X VIEWPOINT *Viewpoint = (VIEWPOINT *) Object;
- X
- X Get_Rotation_Transformation(&Transformation, Vector);
- X MTransformVector (&(Viewpoint -> Location),
- X &(Viewpoint -> Location), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Direction),
- X &(Viewpoint -> Direction), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Up),
- X &(Viewpoint -> Up), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Right),
- X &(Viewpoint -> Right), &Transformation);
- X }
- X
- Xvoid Scale_Viewpoint (Object, Vector)
- X OBJECT *Object;
- X VECTOR *Vector;
- X {
- X TRANSFORMATION Transformation;
- X VIEWPOINT *Viewpoint = (VIEWPOINT *) Object;
- X
- X Get_Scaling_Transformation(&Transformation, Vector);
- X MTransformVector (&(Viewpoint -> Location),
- X &(Viewpoint -> Location), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Direction),
- X &(Viewpoint -> Direction), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Up),
- X &(Viewpoint -> Up), &Transformation);
- X
- X MTransformVector (&(Viewpoint -> Right),
- X &(Viewpoint -> Right), &Transformation);
- X }
- X
- END_OF_FILE
- if test 4251 -ne `wc -c <'src/viewpnt.c'`; then
- echo shar: \"'src/viewpnt.c'\" unpacked with wrong size!
- fi
- # end of 'src/viewpnt.c'
- fi
- if test -f 'src/withfile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/withfile'\"
- else
- echo shar: Extracting \"'src/withfile'\" \(277 characters\)
- sed "s/^X//" >'src/withfile' <<'END_OF_FILE'
- XFROM
- X lib:c.o
- X trace.o
- X render.o
- X tokenize.o
- X parse.o
- X objects.o
- X quadrics.o
- X spheres.o
- X planes.o
- X triangle.o
- X lighting.o
- X prioq.o
- X texture.o
- X matrices.o
- X csg.o
- X colour.o
- X viewpnt.o
- X ray.o
- X iff.o
- X gif.o
- X gifdecod.o
- X raw.o
- X amiga.o
- END_OF_FILE
- if test 277 -ne `wc -c <'src/withfile'`; then
- echo shar: \"'src/withfile'\" unpacked with wrong size!
- fi
- # end of 'src/withfile'
- fi
- echo shar: End of archive 1 \(of 10\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.
-